package com.lyy.service.impl;



import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lyy.entity.Chapter;
import com.lyy.mapper.ChapterMapper;
import com.lyy.service.ChapterService;
import lombok.Data;

import java.util.List;

/**
 * @author Liangyaoyun
 */
@Data
public class ChapterServiceImpl implements ChapterService {
    private ChapterMapper chapterMapper;

    @Override
    public int insertByChapterId(Chapter chapter) {

        return chapterMapper.insertByChapterId(chapter);
    }

    @Override
    public int deleteByChapterId(Integer chapter) {
        return chapterMapper.deleteByChapterId(chapter);
    }

    @Override
    public int updateByChapterId(Chapter chapter) {

        return chapterMapper.updateByChapterId(chapter);
    }

    @Override
    public int deleteByChapterIds(List<Integer> chapterId) {
        return chapterMapper.deleteByChapterIds(chapterId);
    }

    @Override
    public Chapter selectByChapterId(Integer chapter) {

        return chapterMapper.selectByChapterId(chapter);
    }


    @Override
    public List<Chapter> selectAllChapter() {
        return chapterMapper.selectAllChapter();
    }

    @Override
    public PageInfo<Chapter> selectBypage(Integer pageNumber, Integer pageSize) {
        PageHelper.startPage(pageNumber,pageSize);
        return new PageInfo<>(chapterMapper.selectAllChapter());
    }


}
